package com.woniuxy.intellihome.service.impl;

import com.woniuxy.intellihome.entity.Review;
import com.woniuxy.intellihome.mapper.ReviewMapper;
import com.woniuxy.intellihome.service.ReviewService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-08-11
 */
@Service
public class ReviewServiceImpl extends ServiceImpl<ReviewMapper, Review> implements ReviewService {
    @Autowired
    private ReviewMapper reviewMapper;

    @Override
    public void delete(int id) {
        reviewMapper.deleteById(id);
    }

    @Override
    public void addReview(String content, String type, String time, int userId, int skuId) {
        reviewMapper.addReview(content, type, time, userId, skuId);
    }

    @Override
    public List<Review> getBySkuid(int sku_id) {
        return reviewMapper.getBySkuid(sku_id);
    }
}
